#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import math

# 函数定义：使用def语句，def functionName(args): # ...
def my_abs(x):
    if not isinstance(x,(int,float)):
        raise TypeError('类型异常')
    else:
        if x > 0:
            return x
        else:
            return -x

#print(my_abs('10'))

# 定义一个空函数
def nop():
    pass

# 返回多个值
def move(x,y,step,angle=0):
    x = x + step * math.cos(angle)
    y = y + step * math.sin(angle)
    return x,y

x,y = move(10,10,2,math.pi/6)
print(x,y) # 11.732050807568877, 11.0
print(move(10,10,2,math.pi/6)) # (11.732050807568877, 11.0)